package com.ff.neuropp.controller;


import com.ff.neuropp.service.AppCourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * app端 课程信息
 */
@RestController
@RequestMapping("/app/course")
@Api(value = "app课程controller", tags = {"app课程接口"})
public class AppCourseController {

    @Autowired
    private AppCourseService courseService;



    @GetMapping("/list")
    @ApiOperation(value = "课程列表", notes = "课程列表")
    public Map<String,Object> courseList(@ApiParam(required = false, value = "课程名称 模糊搜索") @RequestParam(required = false) String courseName){
        return courseService.courseList(courseName);
    }



    @GetMapping("/detail")
    @ApiOperation(value = "课程详情", notes = "课程详情")
    public Map<String,Object> detail(@ApiParam(required = false, value = "课程id") @RequestParam(required = true) Integer  id){
        return courseService.courseDetail(id);
    }
    
    

}
